package com.qsl.ssyx.activity.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qsl.ssyx.model.acl.Role;
import com.qsl.ssyx.model.activity.ActivityInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qsl.ssyx.model.activity.ActivityRule;
import com.qsl.ssyx.model.activity.ActivitySku;
import com.qsl.ssyx.model.activity.CouponInfo;
import com.qsl.ssyx.model.order.CartInfo;
import com.qsl.ssyx.vo.activity.ActivityRuleVo;
import com.qsl.ssyx.vo.order.CartInfoVo;
import com.qsl.ssyx.vo.order.OrderConfirmVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 活动表 服务类
 * </p>
 *
 * @author 青衫泪
 * @since 2023-08-28
 */
public interface ActivityInfoService extends IService<ActivityInfo> {

    // 条件分页查询
    IPage<ActivityInfo> selectPage(Page<ActivityInfo> pageParam);

    // 根据营销活动Id查询 营销活动规则和活动范围
    Map<String, Object> getActivityRuleById(Integer activityInfoId);


    // 根据ActivityInfoId删除，`activity_info``activity_rule``activity_sku`
    boolean removeByActivityInfoId(Integer activityInfoId);

    //    新增规则： `activity_info``activity_rule``activity_sku`，sku_info
    boolean saveActivityRule(ActivityRuleVo activityRuleVo);


    //    根据skuId列表获取促销信息
    Map<Long, List<String>> getActivityInfoBySkuId(List<Long> skuIdList);

    //    根据商品id和用户id获取优惠卷信息
    Map<String, Object> getActivityInfoBySkuIdAndUserId(Long skuId, Long userId);

    //    根据商品id查询优惠卷信息
    public List<ActivityRule> getActivityRuleBySkuId(Long skuId);

    //    获取购物车里面满足条件优惠卷和活动的信息
    OrderConfirmVo findCartActivityAndCoupon(List<CartInfo> cartInfoList, Long userId);

    //    促销活动相关信息
    List<CartInfoVo> findCartActivityList(List<CartInfo> cartInfoParamList);



}
